import 'package:flutter/material.dart';

class Home extends StatelessWidget {
  const Home({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // List<Tab> _tabs = [
    //   Tab(text: 'Home', icon: Icon(Icons.home),),
    //   Tab(text: 'Search', icon: Icon(Icons.search),),
    //   Tab(text: 'Mail', icon: Icon(Icons.mail),),
    // ];

     List<Tab> _tabs = [
      Tab(text: 'Home',),
      Tab(text: 'Search',),
      Tab(text: 'Mail',),
    ];

    final List<Widget> tabViews = [
      Icon(
        Icons.home,
        color: Colors.blue,
      ),
      Icon(
        Icons.search,
        color: Colors.red,
      ),
      Icon(
        Icons.mail,
        color: Colors.yellow,
      ),
    ];
    return DefaultTabController(
      length: _tabs.length, 
        child: Scaffold(
        appBar: AppBar(
          title: Text("Tabbar Page"),
          bottom: TabBar(
            tabs: _tabs,
            labelColor: Colors.red,
            unselectedLabelColor: Colors.black45,
            indicatorSize: TabBarIndicatorSize.label,
          ),
        ),
        body: TabBarView(children: tabViews),
        // bottomNavigationBar: TabBar(
        //   tabs: _tabs,
        //   labelColor: Colors.blue,
        //   unselectedLabelColor: Colors.black45,
        //   indicatorSize: TabBarIndicatorSize.label,
        // ),
    )
    );
  }
}

// class TabbarPage extends StatelessWidget {
//   const TabbarPage({Key? key}) : super(key: key);

//   @override
//   Widget build(BuildContext context) {
//     final List<Widget> tabViews = [
//       Icon(
//         Icons.home,
//         color: Colors.blue,
//       ),
//       Icon(
//         Icons.search,
//         color: Colors.red,
//       ),
//       Icon(
//         Icons.mail,
//         color: Colors.yellow,
//       ),
//     ];
//     return DefaultTabController(length: tabViews.length, child: TabBarView(children: tabViews));
//   }
// }
